
GOPATH:=$(shell go env GOPATH)

.PHONY: proto test docker


proto:
	protoc --proto_path=${GOPATH}/src:. --micro_out=. --go_out=. proto/greeter.proto

build: proto

	CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o example-srv main.go plugin.go

build-mac: proto

	go build -o micro-example-srv main.go plugin.go
test:
	go test -v ./... -cover

build-win: proto

	CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o micro-example-srv main.go plugin.go

docker:
	docker build . -t example-srv:latest
